package com.itgaohe.controller;

import com.itgaohe.dao.entity.UserInfo;
import com.itgaohe.service.UserInfoService;
import com.itgaohe.utils.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping
@Tag(name = "用户详情管理", description = "用户相关操作")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    /**
     * 获取用户详细信息
     */
    @Operation(summary = "获取用户详细信息")
    @GetMapping("/user/info/{userId}")
    public Result getUserInfo(@PathVariable int userId) {
        return Result.ok(userInfoService.getUserInfo(userId)) ;
    }

}
